package com.woniuxy.entity.es;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;

/**
 * @Author: 马宇航
 * @Todo: TODO
 * @DateTime: 25/09/04/星期四 17:37
 * @Component: 成都蜗牛学苑
 **/

@Document( indexName = "woniumall")
public class WoniuMail {
    public WoniuMail() {
    }

    public WoniuMail(String id, String name, String goodsno, String publisher, String pubtime, String description, BigDecimal salesprice, int salenums) {
        this.id = id;
        this.name = name;
        this.goodsno = goodsno;
        this.publisher = publisher;
        this.pubtime = pubtime;
        this.description = description;
        this.salesprice = salesprice;
        this.salenums = salenums;
    }

    @Id
    @Field(name = "id",type = FieldType.Keyword)
    private String id;
    //text类型：进行分词，存储分词后的结果
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String name;
    @Field(type = FieldType.Text)
    private String goodsno;
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String publisher;
    @Field
    private String pubtime;
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String description;
    @Field
    private BigDecimal salesprice;
    @Field
    private int salenums;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGoodsno() {
        return goodsno;
    }

    public void setGoodsno(String goodsno) {
        this.goodsno = goodsno;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public String getPubtime() {
        return pubtime;
    }

    public void setPubtime(String pubtime) {
        this.pubtime = pubtime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public BigDecimal getSalesprice() {
        return salesprice;
    }

    public void setSalesprice(BigDecimal salesprice) {
        this.salesprice = salesprice;
    }

    public int getSalenums() {
        return salenums;
    }

    public void setSalenums(int salenums) {
        this.salenums = salenums;
    }

    @Override
    public String toString() {
        return "WoniuMail{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", goodsno='" + goodsno + '\'' +
                ", publisher='" + publisher + '\'' +
                ", pubtime='" + pubtime + '\'' +
                ", description='" + description + '\'' +
                ", salesprice=" + salesprice +
                ", salenums=" + salenums +
                '}';
    }
}
